package com.zbs.framework.swagger.entity.eolink;

import com.zbs.framework.swagger.utils.DateUtils;
import lombok.Data;

@Data
public class BaseInfoModel {
    private String apiName;
    private String apiURI;
    private Integer apiProtocol;
    private String apiSuccessMock;
    private String apiFailureMock;
    private Integer apiRequestType;
    private Integer apiStatus;
    private Integer starred;
    private Integer apiNoteType;
    private String apiNoteRaw;
    private String apiNote;
    private Integer apiRequestParamType;
    private String apiRequestRaw;
    private Integer apiRequestBinary;
    private String apiFailureStatusCode;
    private String apiSuccessStatusCode;
    private String apiFailureContentType;
    private String apiSuccessContentType;
    private Integer apiRequestParamJsonType;
    private Integer advancedSetting;
    private String beforeInject;
    private String afterInject;
    private String createTime;
    private String apiUpdateTime;
    private String apiTag;

    public BaseInfoModel(String apiName, String apiURI,Integer apiRequestType,Integer apiRequestParamType) {
        this.apiName = apiName;
        this.apiURI = apiURI;
        this.apiProtocol = 0;
        this.apiSuccessMock = "";
        this.apiFailureMock = "";
        this.apiRequestType = apiRequestType;
        this.apiStatus = 0;
        this.starred = 0;
        this.apiNoteType = 1;
        this.apiNoteRaw = "";
        this.apiNote = "";
        this.apiRequestParamType = apiRequestParamType;
        this.apiRequestRaw = "";
        this.apiRequestBinary = null;
        this.apiFailureStatusCode = "200";
        this.apiSuccessStatusCode = "200";
        this.apiFailureContentType = "text/html; charset=UTF-8";
        this.apiSuccessContentType = "text/html; charset=UTF-8";
        this.apiRequestParamJsonType = 0;
        this.advancedSetting = null;
        this.beforeInject = "";
        this.afterInject = "";
        this.createTime = DateUtils.getNow();
        this.apiUpdateTime = DateUtils.getNow();
        this.apiTag = "";
    }

    public static BaseInfoModel build(String apiName, String apiURI,Integer apiRequestType,Integer apiRequestParamType) {
        return new BaseInfoModel(apiName, apiURI, apiRequestType, apiRequestParamType);
    }
}
